package com.wgj.android.widget;

import android.content.Context;
import android.os.Build;
import android.os.SystemClock;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.wgj.android.R;
import com.wgj.android.accesslibility.AccessibilityHelper;
import com.wgj.android.utils.Timer;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2018/1/2.
 */

public class WXStartTimepickerView extends LinearLayout {
    @BindView(R.id.timepicker)
    TextView timepicker;

    private  Callback callback;
    public WXStartTimepickerView(Context context) {
        this(context,null);
    }

    public WXStartTimepickerView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs,0);
    }

    public WXStartTimepickerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        View view= LayoutInflater.from(context).inflate(R.layout.wx_start_timepicker,this);
        ButterKnife.bind(view);
        init();

    }
    private  void  init(){
        new Timer(timepicker, new  Timer.OnCountTimerListener() {
            @Override
            public void onFinish() {
                 if(callback!=null)
                 callback.onFinish();
            }
        }).start();
    }


    public void setCallback(Callback callback) {
        this.callback = callback;
    }

    public interface  Callback{
        void onFinish();
    }
}
